<!DOCTYPE html>
<html>
<head>
<title>Integral System</title>
<meta charset="utf-8">
<meta name="keywords" content="积分管理系统" />
<meta name="description" content="积分管理系统" />

<!-- for-mobile-apps -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!--<link href="http://fonts.useso.com/css?family=Lato:100,300,400,700" media="all" rel="stylesheet" type="text/css" />-->
<link href="__PUBLIC__/Intesys/default/stylesheets/jquery.fancybox.css" media="all" rel="stylesheet" type="text/css" />

<link href="__PUBLIC__/Intesys/default/stylesheets/bootstrap.min.css" media="all" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Intesys/default/stylesheets/font-awesome.css" media="all" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Intesys/default/stylesheets/se7en-font.css" media="all" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/animate.css">
<link href="__PUBLIC__/Intesys/default/stylesheets/style.css" media="all" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Intesys/default/stylesheets/ui.fancytree.css" media="all" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Intesys/default/stylesheets/datepicker.css" media="all" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Intesys/default/stylesheets/daterange-picker.css" media="all" rel="stylesheet" type="text/css" />

<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/loader.css">

<link href="__PUBLIC__/Intesys/default/stylesheets/select2.css" media="all" rel="stylesheet" type="text/css" />
<!--<link href="__PUBLIC__/Intesys/default/stylesheets/isotope.css" media="all" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Intesys/default/stylesheets/fullcalendar.css" media="all" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Intesys/default/stylesheets/wizard.css" media="all" rel="stylesheet" type="text/css" />

<link href="__PUBLIC__/Intesys/default/stylesheets/morris.css" media="all" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Intesys/default/stylesheets/datatables.css" media="all" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Intesys/default/stylesheets/timepicker.css" media="all" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Intesys/default/stylesheets/colorpicker.css" media="all" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Intesys/default/stylesheets/bootstrap-switch.css" media="all" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Intesys/default/stylesheets/typeahead.css" media="all" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Intesys/default/stylesheets/summernote.css" media="all" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/Intesys/default/stylesheets/pygments.css" media="all" rel="stylesheet" type="text/css" />


<link href="__PUBLIC__/Intesys/default/stylesheets/color/green.css" media="all" rel="alternate stylesheet" title="green-theme" type="text/css" />
<link href="__PUBLIC__/Intesys/default/stylesheets/color/orange.css" media="all" rel="alternate stylesheet" title="orange-theme" type="text/css" />
<link href="__PUBLIC__/Intesys/default/stylesheets/color/magenta.css" media="all" rel="alternate stylesheet" title="magenta-theme" type="text/css" />
<link href="__PUBLIC__/Intesys/default/stylesheets/color/gray.css" media="all" rel="alternate stylesheet" title="gray-theme" type="text/css" />-->
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Js/validform/style.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/js/artDialog/skins/blue.css">


<script src="__PUBLIC__/Intesys/default/javascripts/jquery-1.10.2.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/jquery-ui.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/bootstrap.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/date.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/bootstrap-datepicker.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/jquery.fancybox.pack.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/select2.js" type="text/javascript"></script>

<!--
<script src="__PUBLIC__/Intesys/default/javascripts/raphael.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/selectivizr-min.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/jquery.mousewheel.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/jquery.vmap.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/jquery.vmap.sampledata.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/jquery.vmap.world.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/jquery.bootstrap.wizard.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/gcal.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/jquery.dataTables.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/datatable-editable.js" type="text/javascript"></script>

<script src="__PUBLIC__/Intesys/default/javascripts/excanvas.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/jquery.isotope.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/isotope_extras.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/modernizr.custom.js" type="text/javascript"></script>

<script src="__PUBLIC__/Intesys/default/javascripts/styleswitcher.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/wysiwyg.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/summernote.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/jquery.inputmask.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/jquery.validate.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/bootstrap-fileupload.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/bootstrap-timepicker.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/bootstrap-colorpicker.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/bootstrap-switch.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/typeahead.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/morris.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/skycons.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/fitvids.js" type="text/javascript"></script>-->
<script src="__PUBLIC__/Intesys/default/javascripts/daterange-picker.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/jquery.sparkline.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/main.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/respond.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/jquery.fancytree.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/jquery.fancytree.glyph.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/jquery.fancytree.table.js" type="text/javascript"></script>
<!--<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Js/ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Js/ueditor/lang/zh-cn/zh-cn.js"></script>-->
<script src="__PUBLIC__/Intesys/default/javascripts/jquery.easy-pie-chart.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/fullcalendar.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/Intesys/default/javascripts/bootstrap-timepicker.js" type="text/javascript"></script>
<script src="__PUBLIC__/Js/validform/Validform.js"></script>


<if condition="isMobile()">


<script src="/Public/Js/mobiscroll/js/mobiscroll.custom-2.5.2.min.js"></script>
<script src="/Public/Js/mobiscroll/dev/js/mobiscroll.datetime-2.5.1-zh.js"></script>
<script src="/Public/Js/mobiscroll/dev/js/mobiscroll.core-2.5.2-zh.js"></script>
<script src="/Public/Js/mobiscroll/dev/js/mobiscroll.android-2.5.1.js"></script>
<link rel="stylesheet" type="text/css" href="/Public/Js/mobiscroll/css/mobiscroll.custom-2.5.2.min.css">
<style>.dw{z-index:50000;}.dwo{z-index:50000;}</style>
<script>
    function WdatePicker(){

	}

</script>

<else/>

<script src="__PUBLIC__/Admin/js/My97DatePicker/WdatePicker.js"></script>
</if>
<script src="__PUBLIC__/Intesys/default/javascripts/jquery.more.js" type="text/javascript"></script>
<script src="__PUBLIC__/Admin/js/artDialog/artDialog.source.js"></script>
<script src="__PUBLIC__/Admin/js/artDialog/plugins/iframeTools.source.js"></script>
<script src="/Public/Home/TemplateDefault/js/jquery.cookie.js"></script>



<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
<link rel="shortcut icon" type="image/x-icon" href="__PUBLIC__/Intesys/default/images/favicon.ico" media="screen" />
</head>
<body>
<div class="modal-shiftfix">
<script>

<!-- 解决手机端模态框表单错位 -->


<!-- 解决手机端模态框表单错位结束 -->



//显示图片选择框
/*var mydialog = art.dialog;
function showImgBox(curElement){
	art.dialog.data('curElement',curElement);
	art.dialog.open('/Admin/Img/imagesBox.html', {width: 800, height: 500,lock:true,title:'选择图片', ok:function(){
			var d = this.iframe.contentWindow.document;
			var img_url = $(d).find('#Imgselected').attr('img_url');
			$(curElement).parent().find("input[type='hidden']").eq(0).val(img_url);
			$(curElement).val('/Public'+img_url);
			$(curElement).focus();
			$(curElement).blur();
			curElement.src = '/Public'+img_url;
	}});
}

//风格选择	 
function showPagesBox(curElement){
	art.dialog.data('curElement',curElement);
	art.dialog.open('/Admin/Pages/pagesBox.html', {width: 800, height: 500,lock:true,title:'选择显示风格', ok:function(){
			var d = this.iframe.contentWindow.document;
			var img_url = $(d).find('#Imgselected').attr('img_url');
			$(curElement).parent().find("input[type='hidden']").eq(0).val(img_url);
			$(curElement).val('/Public'+img_url);
			$(curElement).focus();
			$(curElement).blur();
			curElement.src = '/Public'+img_url;
	}});
}


    function error(msg){
		var d = artDialog({
			title: '操作错误',
			content: msg,
			cancel: false,
			ok: function () {
				
				}
		});
		d.show();
	}
	function success(msg){
		var d = artDialog({
			title: '操作成功',
			content: msg,
			cancel: false,
			ok: function () {
				
				}
		});
		d.show();
	}
	
	function sall(){
		
		$('.sall').each(function(index, element) {
            if($(this).prop('checked')== true){
				$(this).prop('checked',false);
				$(this).parent('.checked').removeClass('checked');
			}else{

				$(this).prop('checked',true);
				$(this).parent().addClass('checked');
			}
        });
  
	}
	
	function rall(){
		$('.sall').prop('checked',false);
		$('.sall').parent().removeClass('checked')
	}
	
	
	//移动内容 到分类
	function movenews(e){
		var ids=new Array();
		$('.sall').each(function(index, element) {
            if($(this).attr('checked')=='checked'){
				ids.push($(this).val());
			}
        });
		if(ids.length>0){
			if(confirm('您确定要移动选中记录吗？')){
			    window.location.href="/Admin/Menugroup/move.html?id="+ids.toString()+"&category_id="+e.value;
			}else{
				return false;
			}
		}else{
			error('请选择要移动的记录');
		}
	}
	function delall(){
		var ids=new Array();
		$('.sall').each(function(index, element) {
            if($(this).prop('checked')== true){
				ids.push($(this).val());
			}
        });
		if(ids.length>0){
			if(confirm('您确定要删除选中记录吗？')){
			    window.location.href="/Admin/Menugroup/delete.html?id="+ids.toString();
			}else{
				return false;
			}
		}else{
			error('请选择要删除的记录');
		}
	}
	
	
	function ajaxText(e){
		var tablename = $(e).parent().attr('tablename');
		var field = $(e).parent().attr('field');
		var id = $(e).parent().attr('id');
		var val = $(e).val();
		$.post('/Admin/Menugroup/ajaxText.html',{tablename:tablename,field:field,id:id,val:val},function(data){
			if(data.status == 1){
			    $(e).parent().text(data.data);
			}else{
				alert(data.info);
			}
		},'json');
	}
	
	$(document).ready(function(e) {
		//点击ajax修改文字
		$('span.ajaxText').each(function(index, element) {
			$(this).click(function(e) {
				if($(this).find('input').length == 0){
			    var text = $(this).text();
                var input = $('<input type="text" onBlur="ajaxText(this);" style="width:100%; max-width:100%;" class="form-control" value="">');
				$(this).empty();
				input.appendTo($(this));
				input.focus().val(text);
				}
            });
            
        });
		
		//清除缓存
		$('#clearCache').click(function(e) {
            $.post('/Admin/Menugroup/clearCache.html',{},function(data){
				if(data.status == 1){
					$.ThinkBox.success(data.info,{'delayClose':100});
				}else{
					$.ThinkBox.error(data.info,{'delayClose':200});
				}
			},'json');
        });
		
		//表单验证
		$(".checkoutform:eq(0)").Validform({
			ajaxPost:true,
			tiptype:function(data,s){
				if(s.type == 1){
					$.ThinkBox.success(data,{'delayClose':100});
				}
			},
			callback:function(data){
				//检测登录 
				
				if(data.status == 0){
					$.ThinkBox.error(data.info,{'delayClose':200});
					
				}else{
					
					$.ThinkBox.success(data.info,{'delayClose':200}); 
					    
							try{
							    window.parent.submitSuccess(data.status,data.info,data.data);
								mydialog.close();
							}catch (e){
								window.parent.location.href=data.url;
							}
						
				}
			}
	    });
 		//头部菜单 
		$('.topmenu').each(function(index, element) {
            $(this).mouseenter(function(e) {
				$(this).addClass('cur');
                $(this).find('ul').removeClass('h');
            });
			$(this).mouseleave(function(e) {
				$(this).removeClass('cur');
                $(this).find('ul').addClass('h');
            });
        });
		
		
        $('.data_list').each(function(index, element) {
            $(this).mouseenter(function(e) {
                $(this).css({'background':'#D7F7F9'});
            });
			$(this).mouseleave(function(e) {
                $(this).css({'background':'#fff'});
            });
			$(this).find("input[type='checkbox']").click();
			$(this).find("input[type='checkbox']").click(function(){
					if($(this).attr('checked')=='checked'){
					
					    $(this).attr('checked',false);
				    }else{
					    $(this).attr('checked',true);
				    }
				});
			$(this).find("input[type='checkbox']").parent().click(function(e) {
				
                if($(this).find("input[type='checkbox']").attr('checked')=='checked'){
					
					$(this).find("input[type='checkbox']").attr('checked',false);
				}else{
					$(this).find("input[type='checkbox']").attr('checked',true);
				}
            });
        });

		
		//异步更新int字段
		$('.status_btn').each(function(index, element) {
            $(this).click(function(e) {
				$.ajax({
					url:"/Admin/Menugroup/ajaxUpdate.html",
					type:"post",
					data:"data="+$(this).attr('field'),
					dataType:"json",
					success: function(data){
						if(data.status==1){
							$('.status_btn').eq(index).removeClass("status1");
							$('.status_btn').eq(index).removeClass("status0");
							$('.status_btn').eq(index).addClass("status"+data.data);
						}
					}
				});
            });
        });
    });
	
	//更新排序
	//key主键/field更新字段名/el当前按钮对象/url服务端地址
	function update_sort(key,field,el,url){
		var data=new Array();
		$("input[name='"+key+"']").each(function(index, element) {
            data.push($(this).val()+'_'+$(this).parent().parent().find("input[name='"+field+"']").val());
        });
		$.post(url,{'sort':data.toString(),'field':field},function(data){
			if(data=='OK'){
				if(el==''){
					success('更新成功');
				}
			}else{
				error('更新失败');
			}
		});
	}
	
	//更新排序,点击移动更新
	function update_sortClick(key,type,el,field,sendurl){
		var data=new Array();
		if(type=='up'){
			$(el).parent().parent().after($(el).parent().parent().prev());
		}else{
			$(el).parent().parent().next().after($(el).parent().parent());
		}
		$("input[name='"+key+"']").each(function(index, element) {
			$(this).parent().parent().find("input[name='"+field+"']").val(index+1);
            data.push($(this).val()+'_'+$(this).parent().parent().find("input[name='"+field+"']").val());
        });
		
		//列新排序
		update_sort(key,field,el,sendurl);
	}*/
</script> 
<script>
//将窗口选中的选项设置到相应name的文本框中（一般当作回调函数来使用）
function setInputValue(name){
	var name=name||'memberid';
	var str="";
	var strname="";
	$(".f-view [name='input']:checked").each(function(index, element) {
		str+=","+$(this).val();
		strname+=","+$(this).next().text();
	});
	$(".f-fill"+name).val(strname.substr(1));
	$(".form-control[name='"+name+"']").val(str.substr(1));	
}
function add0(m){return m<10?'0'+m:m }
function format(time)
{
    //shijianchuo是整数，否则要parseInt转换
	time=Number(time)*1000;
    var time = new Date(time);
    var y = time.getFullYear();
    var m = time.getMonth()+1;
    var d = time.getDate();
    var h = time.getHours();
    var mm = time.getMinutes();
    var s = time.getSeconds();
    return y+'-'+add0(m)+'-'+add0(d)+' '+add0(h)+':'+add0(mm)+':'+add0(s);
}
$(function(){
	/*$(".f-fillwidth").click(function(e) {
		setTimeout(function(){
			$(".note-editable").css('width',$(".note-editable")[0].offsetWidth+'px');
			console.log(); 
		},500);
	});*/
    $(".f-ruleinfo").change(function(e) {
        var _this=$(this).parents("form");
        $.getJSON("__GROUP__/Integral_rule/getruleone",{'id':$(this).val()},function(data){
            if(data.statu==1){
                _this.find('[name="changenum"]').val(data.integralruleinfo['integralnum']);
                _this.find('.edui-default iframe').contents().find("body p").html(data.integralruleinfo['remark']);
            }    
        });
    });
    //当积分规则类型改变，显示相应的积分规则
    $(".typeevent").on("change",".integralruletype",(function(e) {
        $.post("__GROUP__/Integral_rule/getrule",{'typeid':$(this).val()},function(data){
            if(data.statu!=1){return;}
            $(".integralrule").html('<option value="">请选择</option>');
            $(data.integralrule).each(function(index, element) {
                $(".integralrule").append("<option value='"+element['id']+"'>"+element['name']+"</option>");
            });	
        },'json');
    }));
    //当部门改变，显示相应部门的员工
    $(".groupid").change(function(e) {
		var group=$(this).parent().parent();
        $.getJSON("__GROUP__/Integral_rule/getmember",{'groupid':$(this).val()},function(data){
            if(data.statu!=1){return;}
            group.find(".memberid").html('<option value="">请选择</option>');
            $(data.member).each(function(index, element) {
                group.find(".memberid").append('<option value="'+element.id+'">'+element.name+'</option>');
            });
       });
    }); 
    //当部门改变，显示相应部门的员工(不包含自己)
    $(".groupid2").change(function(e) {
        $.getJSON("__GROUP__/Integral_rule/getmember2",{'groupid':$(this).val()},function(data){
            if(data.statu!=1){return;}
            $(".memberid2").html('<option value="">请选择</option>');
            $(data.member).each(function(index, element) {
                $(".memberid2").append('<option value="'+element.id+'">'+element.name+'</option>');
            });
       });
    }); 
    $(".f-fill").click(function(e) {
        console.log($($(this).attr("href")).find(".form-group .form-control"));
        $($(this).attr("href")).find(".form-group .form-control").each(function(index, element) {
            $(this).val($(".widget-content .row  [data-name='"+$(this).attr('name')+"']").html());
        });;
    });
	
    //在选择员工窗口，当点击确定时将所有选择的复选框的ID填充进文本框
    $("#fancybox1").on("click",".f-getstaff",function(e) {
        var str="";
        var strname="";
        $("[name='staff']:checked").each(function(index, element) {
            str+=","+$(this).val();
            strname+=","+$(this).next().text();
        });
		$(".f-fillname").val(strname.substr(1));
        $("[name='memberid']").val(str.substr(1));
        $("[name='pid']").val(str.substr(1));
        $(".fancybox-close").click();
    });
    $("#fancybox1").on("click",".f-getstaffRadio",function(e) {
        var str="";
        var strname="";
        $("[name='staff']:checked").each(function(index, element) {
            str+=","+$(this).val();
            strname+=","+$(this).next().text();
        });
		$(".f-fillnameRadio").val(strname.substr(1));
        $("[name='executor_id']").val(str.substr(1));
        $(".fancybox-close").click();
    });
    $("#fancybox1").on("click",".f-getrule",function(e) {
        var str="";
        var strname="";
        $("[name='rule']:checked").each(function(index, element) {
            str+=","+$(this).val();
            strname+=","+$(this).next().text();
        });
		$(".f-fillrule").val(strname.substr(1));
        $("[name='ruleid']").val(str.substr(1));
        $(".fancybox-close").click();
    });
	
    //在选择员工窗口，当点击全选时全部复选框选择     
    $("#fancybox1").on("click",".checkall",function(e) {
        var checkstatu=$(this).find("input")[0].checked;
        $(this).parents("#fancybox1").find('[type="checkbox"]').each(function(index, element) {
            $(this)[0].checked=checkstatu;
        });
    }); 
    //点击提交的时候，将编辑器里的内容填充至文本框中
    if($(".note-editor").length>0){
        $(".btn[type='submit']").click(function(e) {
            $(this).parents("form").find("textarea").html($(this).parents("form").find(".note-editable").html());
        });
        $(".note-editor .note-toolbar").html($(".note-editor .note-toolbar").html().replace(/undefined/g,''));    
    }
	if($(".note-editor").length){
		$(".note-editor .note-toolbar").html($(".note-editor .note-toolbar").html().replace(/undefined/g,''));    
	}
    //是否进行此操作
    $(".f-confirm").click(function(e) {
        if(!confirm('您确定要进行此操作吗？')){ e.preventDefault(); return;}
    });
}); 
</script>
<script>
$(document).ready(function(e) {
	/**************************************************/
	/* 列表中item删除 */
	/**************************************************/
	$('.delete-row').each(function(index, element) {
		$(this).click(function(e) {
			showInfoAlert("温馨提示","确定删除此记录吗？",function(){
				$.get($(element).attr('href'), {}, function(data){
					if(data.status == 1){
						hideInfoAlert();
						$('.'+$(element).attr('row')).remove();
					}else{
						
					}
				}, 'json');
			});
			return false;
		});
	});
	/**************************************************/
	/* 列表中item查看 */
	/**************************************************/
	$('#datatable-editable').each(function(index, element) {
		$('a.fancybox').click(function(e) {
			 $("#fancybox ul").html("");
			var th=$(this).parents("table").find("thead tr th");
			$(this).parents(".data_list").find("td:not(:last)").each(function(index, element) {
				$("#fancybox ul").append("<p><span class='text-primary'>"+th.eq(index).html()+": </span>"+$(this).html()+"</p>");
			});
		});
	});
});
/******************************************************/
/*弹窗显示   开始*/
/******************************************************/

function showInfoAlert(title,context,sureCall){
	infoAlert(title,context);
	$("#infomodal").modal("show");
	$("#footbtnsure").click(function(){sureCall();});
}

function hideInfoAlert(){
	$("#infomodal").modal("hide");
}
 
function infoAlert(title,context){
	msgw=200;//提示窗口的宽度
	msgh=100;//提示窗口的高度
	titleheight=25 //提示窗口标题高度
	modal = null;
	if(modal==null){
		var modal = document.createElement("div");
	}
	modal.setAttribute("class","modal fade");
	//modal.setAttribute("style","display: none;");
	modal.setAttribute("id","infomodal");
	modal.style.background="white";
	modal.style.border="5px solid " + "#336699";
	//modal.style.position = "absolute";
	modal.style.left = "50%";
	modal.style.top = "50%";
	modal.style.marginLeft = "-115px" ;
	modal.style.marginTop = -115+document.documentElement.scrollTop+"px";
	modal.style.width = msgw + "px";
	modal.style.height = msgh + "px";
	modal.style.textAlign = "center";
	modal.style.overflow = "hidden";
	//modal.style.lineHeight = (msgh-titleheight) + "px";
	modal.style.zIndex = "10001";
	if(dialog==null){
		var dialog = document.createElement("div");
	}
	dialog.setAttribute("class","modal-dialog");
	dialog.style.width='auto';
	dialog.style.padding = "5px 0 5px 0";
	if(content==null){
		var content = document.createElement("div");
	}
	content.setAttribute("class","modal-content");
	content.style.width='auto';
	if(header==null){
		var header = document.createElement("div");
	}
	header.style.borderBottom="1px solid " + "#336699";
	//header.setAttribute("class","modal-header");
	if(abody==null){
		var abody = document.createElement("div");
	}
	abody.style.width='auto';
	//abody.setAttribute("class","modal-body");
	if(footer==null){
		var footer = document.createElement("div");
	}
	footer.style.width='auto';
	footer.style.borderTop="1px solid " + "#336699";
	//footer.setAttribute("class","modal-footer");
	
	if(myTitle==null){
	 var myTitle=document.createElement("h4");
	 myTitle.style.marginBottom="5px";
	}
	myTitle.setAttribute("align","center");
	myTitle.innerHTML = title;
	if(myContext==null){
	 var myContext=document.createElement("p");
	}
	myContext.setAttribute("align","center");
	myContext.style.margin="5px 0 5px 0"
	myContext.innerHTML = context;
	if(footBtnSure==null){
	 var footBtnSure=document.createElement("button");
	}
	footBtnSure.setAttribute("id","footbtnsure");
	console.log($("#footbtnsure").length);
	
	//footBtnSure.setAttribute("onClick","mySureCall()");
	footBtnSure.style.width='60px'
	footBtnSure.style.margin = "2px 20px 2px 0" ;
	footBtnSure.innerHTML = "确定";
	if(footBtnCencle==null){
	 var footBtnCencle=document.createElement("button");
	}
	footBtnCencle.setAttribute("onClick","hideInfoAlert()");
	footBtnCencle.style.width='60px'
	footBtnCencle.style.margin = "2px 0 2px 20px" ;
	footBtnCencle.innerHTML = "取消";
	
	
	header.appendChild(myTitle);
	abody.appendChild(myContext);
	footer.appendChild(footBtnSure);
	footer.appendChild(footBtnCencle);
	content.appendChild(header);
	content.appendChild(abody);
	content.appendChild(footer);
	dialog.appendChild(content);
	modal.appendChild(dialog);
	
	document.body.appendChild(modal);
}

/******************************************************/
/*弹窗显示  结束*/
/******************************************************/
</script>
<script>

//消息框消失
this.disappear=function(){
	 $("#bgdiv").remove();
	 $("#msgdiv").remove();
	 $("#msgtitle").remove();
	};
//消息框渐变调用消失
this.fadeout=function(time){
	$("#bgdiv").fadeOut(time);
	$("#msgdiv").fadeOut(time);
	$("#msgtitle").fadeOut(time,function(){disappear()});
}
//设置消息框标题
this.setCaption=function(caption){
	$("#msgtitle").text(caption);
}
//设置消息框内容
this.setContent=function(content){
	$("#msgtxt").text(content);
}
this.validInsert=function(beforeSubmit,callback){
	myValidform("valid-insert",beforeSubmit,callback);
}
this.validUpdate=function(beforeSubmit,callback){
	myValidform("valid-update",beforeSubmit,callback);
}
this.myValidform = function(elemtclass,beforeSubmit,callback){
	  $("."+elemtclass).Validform({
		  //btnSubmit:"#submit",
		  tiptype:3,
		  dragonfly:false,//默认false，当为true时，值为空时不做验证；
		  postonce:false,//表单是否只能提交一次
		  ajaxPost:true,
		  showAllError:false,
		  tipSweep:false,//为true时提示信息将只会在表单提交时触发显示
		  beforeCheck:function(curform){
		//在表单提交执行验证之前执行的函数，curform参数是当前表单对象。
		//这里明确return false的话将不会继续执行验证操作;    
		},
		  beforeSubmit:function(curform){
			  beforeSubmit(curform);
			  $('#loag-progress').show();
		//在验证成功后，表单提交前执行的函数，curform参数是当前表单对象。
		//这里明确return false的话表单将不会提交;  
		},
		callback:function(data){
			if(data.status==1){
				callback(data);
			}
			$("#Validform_msg").fadeOut(2000);
			$("."+elemtclass).modal("hide");
		}
	})
}
//消息框
this.myAlert=function(caption,content){
	disappear();
		msgobj=null;
		msgdiv=null;
   this.m_text=content;
   this.m_caption=caption;
   this.m_width=200;
   this.m_height='auto';
   this.m_wait=1000;
   this.m_fade=500;
   this.m_bordercolor="#336699";
   this.m_titlecolor="#99ccff";
   var msgw,msgh,bordercolor;
   msgw=m_width;//提示窗口的宽度
   msgh=m_height;//提示窗口的高度
   titleheight=25 //提示窗口标题高度
   bordercolor=m_bordercolor;//提示窗口的边框颜色
   titlecolor=m_titlecolor;//提示窗口的标题颜色
   
   var swidth,sheight;
   swidth=document.body.offsetWidth;
   sheight=document.body.offsetHeight;
   if (sheight<screen.height)
   {
    sheight=screen.height;
   }
   // //此处可以添加一个背景，防止多次点击保存按钮
   // if(bgobj==undefined){
   // var bgobj=document.createElement("div");
   // }
   // bgobj.setAttribute('id','bgdiv');
   // bgobj.style.position="absolute";
   // bgobj.style.top="0";
   // bgobj.style.background="#777";
   // bgobj.style.filter="progid:dximagetransform.microsoft.alpha(style=3,opacity=25,finishopacity=75";
   // bgobj.style.opacity="0.6";
   // bgobj.style.left="0";
   // bgobj.style.width=swidth + "px";
   // bgobj.style.height=sheight + "px";
   // bgobj.style.zindex = "10000";
   // document.body.appendChild(bgobj);
   if(msgobj==null){
   	var msgobj=document.createElement("div");
   }
   msgobj.setAttribute("id","msgdiv");
   msgobj.setAttribute("align","center");
   msgobj.style.background="white";
   msgobj.style.border="1px solid " + bordercolor;
   msgobj.style.position = "absolute";
	msgobj.style.left = "50%";
	msgobj.style.top = "50%";
	msgobj.style.font="12px/1.6em verdana, geneva, arial, helvetica, sans-serif";
    msgobj.style.marginLeft = "-115px" ;
	msgobj.style.marginTop = -115+document.documentElement.scrollTop+"px";
	msgobj.style.width = msgw + "px";
	msgobj.style.height =msgh + "px";
	msgobj.style.textAlign = "center";
	msgobj.style.lineHeight = (msgh-titleheight) + "px";
	msgobj.style.zIndex = "10001";
	if(title==null){
     var title=document.createElement("h4");
	}
     title.setAttribute("id","msgtitle");
     title.setAttribute("align","center");
     title.style.margin="0";
     title.style.padding="3px";
     title.style.background=bordercolor;
     title.style.filter="progid:dximagetransform.microsoft.alpha(startx=20, starty=20, finishx=100, finishy=100,style=1,opacity=75,finishopacity=100);";
     title.style.opacity="0.75";
     title.style.border="1px solid " + bordercolor;
     title.style.height="20px";
     title.style.font="12px verdana, geneva, arial, helvetica, sans-serif";
     title.style.color="white";
     title.style.cursor="pointer";
     title.innerHTML=caption;
     title.onclick=function(){disappear();msgobj=null;msgdiv=null;}
	document.body.appendChild(msgobj);
	document.getElementById("msgdiv").appendChild(title);
	var txt=document.createElement("p");
	txt.style.margin="1em 0"
	txt.setAttribute("id","msgtxt");
	txt.innerHTML=content;
    document.getElementById("msgdiv").appendChild(txt);
	
	//setTimeout("fadeout(1000)",1000);
};
</script> 